package com.szis.auth.oauth2.controller;

import cn.dev33.satoken.oauth2.SaOAuth2Manager;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * platform客户端
 *
 * @author: yxl
 * 2025-07-19
 */
@RestController
@RequestMapping("/platform")
public class OAuth2ClientController {

    @PostMapping("/getTokenByCode")
    public Object getTokenByCode(@RequestParam String code) {
        return SaOAuth2Manager.getDataResolver().buildAccessTokenReturnValue(SaOAuth2Manager.getDataGenerate().generateAccessToken(code));
    }

}
